package com.ferry.registry.domain.registry;

import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.locks.StampedLock;

/**
 * StampedLock提供了乐观读锁，可取代ReadWriteLock以进一步提升并发性能；
 * StampedLock是不可重入锁
 */
public class RegistryValue {
    private final Set<RegistryMetaData> metaSet = new HashSet<>();
    private final StampedLock lock = new StampedLock();

    public Set<RegistryMetaData> getMetaSet() {
        return metaSet;
    }

    public StampedLock getLock() {
        return lock;
    }

}